﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Drawing;

namespace DrawArray
{   
    public class ArrayDrawer
    {
        private Bitmap bitmap;
        public Bitmap Bitmap
        {
            get { return bitmap; }
            private set { bitmap = value; }
        }
        public ArrayDrawer(int width, int height, int[] drArray, int zoom, int magnifier)
        {
            //zoom - increases thickness of the lines
            //magnifier - increases heights of the lines
            bitmap = new Bitmap(width, height);
            Graphics g = Graphics.FromImage(bitmap);
            g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
            Pen p = new Pen(Color.BlueViolet, zoom);
            for (int i = 0; i < drArray.Length - 1; i++)
            {
                g.DrawLine(p, i * zoom, 0, i * zoom, drArray[i] * magnifier);
            }
            bitmap.RotateFlip(RotateFlipType.Rotate180FlipX);
        }
    }
}
